home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / win / pascal / helpbmp.exe / HLPBMP.TXT < prev   
Text File  |  1992-04-12  |  13KB  |  325 lines

  1. HLPBMP.TXT - Helpful Hints for BMP placement into WinHelp RTF/HLP files
  2.  
  3. 4/12/92
  4.  
  5. This long-winded text file explains some reported problems with
  6. importing and placing bitmapped images into Rich Text Format (RTF)
  7. files, and addresses problems associated with compiling those RTF
  8. files into Windows Help (HLP) files via the Microsoft Help Compiler
  9. (HC.EXE).
  10.  
  11. It won't improve your sex life, or get rid of morning breath, but
  12. it might make it easier to plop graphics into your Windows Help files...
  13.  
  14.  
  15. BACKGROUND
  16. ----------
  17. "Wouldn't it be great if it was easier to add graphics to your
  18. Windows Help files...?"
  19.  
  20. "Wouldn't it be great if the Help Compiler didn't always toss out
  21. my RTF files with an error message...?"
  22.  
  23. Well, sure it would -- on both counts.
  24.  
  25. Lots of fellow TPW users routinely report difficulties importing
  26. bitmaps into the RTF files they plan to compile into Windows
  27. Help files.  Most of these folks use graphical word processors
  28. and feel cheated when they drop graphic images into their RTF text
  29. with the Windows Clipboard, only to see the resulting RTF file die a
  30. horrible death at compile time...
  31.  
  32. A quick glance through the message threads in the Windows SDK forum
  33. indicates that we are not alone; these same complaints are cropping
  34. up from Windows programmers working in a variety of development
  35. platforms.
  36.  
  37. For TPW users, the following scenario is fairly common:
  38.  
  39. We're following the instructions laid out in the Turbo Pascal for
  40. Windows HELP COMPILER booklet, we're using a bona-fide graphical
  41. word processor (commonly Microsoft Word for Windows) for handling
  42. the RTF file and graphics importing/positioning, and we're
  43. attempting to compile our HLP file with the version of HC.EXE that
  44. came bundled with TPW...
  45.  
  46. ...and we're still getting the same old "Unrecognized Graphic Format..."
  47. error message at compile time, despite the fact that we're following
  48. each and every one of the HELP COMPILER instructions to the LETTER.
  49.  
  50.  
  51. JUST THE FACTS, MA'AM...
  52. ------------------------
  53. In the way of a solution, there are a few things that we know at the
  54. outset that might or might not help some of you.
  55.  
  56. First off, there has been much made of the limitation on clipboard-
  57. placed bitmap image size that Word for Windows and/or the Help
  58. Compiler imposes.  In addition, more than a few postings in the
  59. Windows SDK forum mention something about a 64 Kb "paragraph size"
  60. ceiling in Word for Windows.
  61.  
  62. One chap in the SDK forum even claimed that he knew one (and only
  63. one) person who used Word for Windows to successfully drop a bitmap
  64. image into an RTF file via the Clipboard "Copy" and "Paste" commands
  65. -- and (mirabile dictu!) the RTF file compiled cleanly into a HLP
  66. file.  He went on to explain (reverently) that this astounding feat
  67. was only possible because the bitmap in question was "very small"
  68. and had been generated using the SDK paint editor!  Oooof!
  69.  
  70. No mention was made of incense burning, animal sacrifice, or the
  71. chanting of mantras.  And the bogey-man was not available for
  72. comment.
  73.  
  74. While much of what you've heard or read on the various Windows
  75. programming forums might be true, it really has precious little
  76. bearing on what Microsoft's Help Compiler is actually able to
  77. "swallow" during HLP file compilation.
  78.  
  79. For the most part, warnings about bitmap image size or WinWord
  80. "paragraph size" seem to be lame attempts at explaining away
  81. the recurring compiler error messages.  In fact, I've been able to
  82. successfully import and position clipboard-placed COLOR bitmapped
  83. images as large as 210x80 pixels with absolutely no problem.  The
  84. RTF files containing these images were then compiled into HLP files
  85. with nary a hiccup.  Ran just fine from WinHelp.  No problemo.
  86.  
  87. These are just examples, mind you.  Certainly, there exists the
  88. potential to make use of even larger images, especially if they are
  89. monochrome bitmaps.
  90.  
  91. From an aesthetic point of view, however, there is some question of
  92. whether you would really WANT to do this.  Past a certain point,
  93. oversized (or overused) graphics can actually DETRACT from the
  94. effectiveness of your Help System file.  Where that particular
  95. point lies for you is YOUR CHOICE, and none of my business anyway.
  96.  
  97.  
  98. THE COMPILER
  99. ------------
  100. Okay, now to the meat and potatoes.
  101.  
  102. First, it might help to establish which version of HC.EXE you have.
  103.  
  104. The version that came bundled with TPW when I purchased it is
  105. version 3.0.  That might or might not be what most of you are using
  106. right now.
  107.  
  108. I'm not going to come right out and say that version 3.0 won't do
  109. the job, because deep down I feel that it does.  What I WILL say is
  110. that version 3.0b is alleged to be "friendlier" as far as RTF files
  111. generated with Microsoft Word for Windows (this, according to posts
  112. and message threads on the CompuServe Windows SDK forum).  True?
  113. False?  Who cares?  3.0b works for me, so I'm not complaining.
  114.  
  115. HC.EXE 3.0b is currently available on the Windows SDK forum.  The
  116. file size is 133,835 Kb, and it isn't compressed (!) so your
  117. download might take quite a while.
  118.  
  119. Note:  There are rumors circulating that version HC.EXE 3.1 is on the
  120. way.  When and if it becomes available, my advise is to snatch it up.
  121.  
  122.  
  123. THE WORD PROCESSOR
  124. ------------------
  125. There are a few excellent shareware utilities out there that convert
  126. ASCII text files to RTF format, allowing the user to avoid having to
  127. mess with "expensive" and "complicated" graphical word processors
  128. like Word for Windows.
  129.  
  130. My HUNCH is that many of the people who use these utilities actually
  131. already have a Windows word processor that supports RTF formats,
  132. already know how to use it, but just can't get the damned thing to
  133. import bitmaps into an RTF file that HC.EXE can compile cleanly.
  134.  
  135. I know that's the category into which I fell.
  136.  
  137. So, what's this to YOU?
  138.  
  139. Well, let's look at the choices available to folks looking to put
  140. graphics into their help files.  According to the HELP COMPILER
  141. manual, we have exactly TWO:
  142.  
  143. 1) You can place the image on the "page" BY REFERENCE (i.e., by
  144. entering formatting code that tells the compiler where to put the BMP
  145. file image.  This will work, but it's not as easy or as flexible as
  146. plopping the image in via the Windows Clipboard.  In addition, this
  147. method requires the inclusion of a [BITMAPS] section in your HPJ file;
  148. the compiler will need you to keep careful track of each bitmap used
  149. in the help file.  For people using a text-only word processor, this
  150. is the only method available -- but if you're programming for Windows,
  151. doesn't that hint that you prefer doing things GRAPHICALLY...?
  152.  
  153. -or-
  154.  
  155. 2) You can place it on the "page" GRAPHICALLY (i.e., copying and
  156. pasting the image via the Windows Clipboard).  In a perfect world,
  157. this would be the quickest, easiest, fuss-free method.
  158.  
  159. The problem is, the world isn't perfect.  Where clipboard-placed
  160. images are concerned, there's more than one way to skin the proverbial
  161. cat, and (in my experience) HC.EXE only accepts ONE of those methods.
  162.  
  163.  
  164. ASSUMPTIONS
  165. -----------
  166. The following instructions make two assumptions about the programs
  167. you're using:
  168.  
  169.     A) You have HC.EXE (3.0b).
  170.     B) You have Word for Windows (2.0)
  171.  
  172. If you have both of the above programs, but not the most recent
  173. version, these instructions might still work.  I just don't want to
  174. make any false promises.
  175.  
  176. If you have a different Windows word processor (WordPerfect for
  177. Windows, Ami Pro, etc.) you're not entirely out of luck.
  178.  
  179. In fact, during a late-night romp through the Windows SDK forum, I
  180. ran across WPWINH.ZIP -- a useful WordPerfect for Windows
  181. macro/resource that addresses and corrects some problems that WPWin
  182. seems to have with RTF files.  WPWINH.ZIP even includes a custom
  183. button bar addition that allows the user to open RTF files with one
  184. click of the mouse.  If you're a WordPerfect for Windows user like
  185. me, it's definitely worth a look-see.
  186.  
  187.  
  188. PROCEDURES
  189. ----------
  190. 1) For starters, the bitmap image(s) should be in Windows BMP
  191. format (color or B/W).  It doesn't much matter what paint program
  192. you use to create the bitmap (some f